package com.py.credit.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.py.credit.dao.YzTestDao;
import com.py.credit.service.YzTestService;
import com.py.credit.utils.SQLBuilder;
import com.py.framework.core.common.Page;

@Service
public class YzTestServiceImpl implements YzTestService {
	@Autowired
	private YzTestDao yzTestDao;

	@Transactional
	@Override
	public void updateLog() {
		yzTestDao.updateLog();
	}

	@Override
	public String selectTableNameByTableId(String tableId) {
		return yzTestDao.selectTableNameByTableId(tableId);
	}

	@Transactional
	@Override
	public void insertLog(String qymc, String tybm, String tableName, String tableId, String url, String code,
			String msg, String batchid) {
		yzTestDao.insertLog(qymc, tybm, tableName, tableId, url, code, msg, batchid);
	}

	@Override
	public List<Map<String, Object>> selectLog() {
		return yzTestDao.selectLog();
	}

	@Override
	public List<Map<String, Object>> selectForPage(List<String> columns, String[] additionalColumns, String condition,
			Page page) {
		List<String> conditions = SQLBuilder.createConditionSql(condition);
		return yzTestDao.selectByConditionForPage(columns, additionalColumns, conditions, page);
	}

}
